﻿using Abp.Domain.Entities.Auditing;
using FutureApp.Users;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FutureApp.Cms
{
    /// <summary>
    /// 消息
    /// </summary>
    [Table("Messages")]
    public class Message : CreationAuditedEntity<Guid, User>
    {
        /// <summary>
        /// <see cref="Title"/> 的最大长度
        /// </summary>
        public const int MaxTitleLength = 50;

        /// <summary>
        /// <see cref="Title"/> 的最大长度
        /// </summary>
        public const int MaxContentLength = 1000;

        /// <summary>
        /// 标题
        /// </summary>
        [Required]
        [StringLength(MaxTitleLength)]
        public string Title { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        [Required]
        [StringLength(MaxContentLength)]
        public string Content { get; set; }

        /// <summary>
        /// 发送时间
        /// </summary>
        [DataType(DataType.DateTime)]
        public DateTime? SendTime { get; set; }
    }
}
